package ru.niir.goodfil.ui.utils;

import javax.faces.application.Application;
import javax.faces.context.FacesContext;

public class FacesUtils {
    public static <T> T getManagedBean(String beanName) {
        return (T) getApplication().getVariableResolver().resolveVariable(FacesContext.getCurrentInstance(), beanName);
    }

    protected static Application getApplication() {
        return FacesContext.getCurrentInstance().getApplication();
    }
}
